Method for panorama image processing

ABSTRACT

An image processing method for obtaining a panoramic image includes obtaining a first image and a second image by a camera unit, and obtaining location information between the viewpoints of the first image and the second image by a gyro. First features of the first image and second features of the second image are obtained according to a feature-capturing algorithm when pixel brightness differences exceed a threshold. Predicted features in the second image are obtained by the location information, and predicted features that exceed a predetermined distance from the second features are discarded. A panorama image is obtained by combining the first image and the second image according to the first features and the selected second features.

FIELD

The subject matter herein generally relates to an image processingmethod, especially improve edge detection when shooting in panoramas.

BACKGROUND

Panoramic photography can be achieved through the horizontal rotation ofthe camera to shoot multiple continuous images. It will be spliced intoa complete image of a complete panoramic image by the software. Butusers are required to take shots in accordance with a certain order andmust pay attention to keep rotational direction. For ordinary users, itis difficult to control the consistent rotation of the camera withoutusing tripods Improvements in the art is preferred.

SUMMARY

In the present disclosure, first features of a first image and secondfeatures of a second image are obtained by edge detection. Predictedfeatures are performed on the second image by a gyroscope (gyro). Thefirst features and the second features are matched by Euclidean distanceand removing the predicted features that exceed a predetermined distancefrom the second features to improve accuracy. The rotation matrixrelationship between the first image and the second image are calculatedby Euler angle. The first image and the second image are correlatedaccording to the calculations to form a panoramic image. This overcomesthe limitation of rotation angle consistency when taking images by therotation matrix relationship with the same value features.

An image processing device for a panorama image includes a camera unit,which captures a first image and a second image. A gyro receiveslocation information of the image processing device. When brightnessdifference exceeds a threshold, a processing unit receives the firstimage and the second image to generate a plurality of first features ofthe first image and a plurality of second features of the second imageaccording to a feature-capturing algorithm Predicted features in thesecond image are obtained by the location information and the predictedfeatures that exceed a predetermined distance from the second featuresare discarded. The panorama image is produced by combining the firstimage and the second image according to the first features and theselected second features.

An image processing method for a panorama image includes capturing afirst image and a second image by a camera unit, and receiving locationinformation of the image processing device from a gyro. A plurality offirst features of the first image and a plurality of second features ofthe second image are obtained according to a feature-capturing algorithmwhen brightness difference exceeds a threshold. Predicted features inthe second image are obtained by the location information and thepredicted features that exceed a predetermined distance are discardedfrom the second features, to obtain the panorama image by combining thefirst image and the second image according to the first features and theselected second features.

BRIEF DESCRIPTION OF THE DRAWINGS

Implementations of the present technology will now be described, by wayof example only, with reference to the attached figures, wherein:

FIG. 1 illustrates a functional block diagram of an image processingdevice according to an exemplary embodiment of the disclosure;

FIG. 2 illustrates a flow diagram of an image processing methodaccording to an exemplary embodiment of the disclosure;

FIG. 3A illustrates a first image according to the exemplary embodimentof the disclosure;

FIG. 3B illustrates a second image according to the exemplary embodimentof the disclosure;

FIG. 3C illustrates a third image according to the exemplary embodimentof the disclosure;

FIG. 4 illustrates another flow diagram of the image processing methodaccording to an exemplary embodiment of the disclosure;

FIG. 5 illustrates an updated threshold of sub-images of the imageprocessing method according to an exemplary embodiment of thedisclosure.

DETAILED DESCRIPTION

It will be appreciated that for simplicity and clarity of illustration,where appropriate, reference numerals have been repeated among thedifferent figures to indicate corresponding or analogous elements. Inaddition, numerous specific details are set forth in order to provide athorough understanding of the exemplary embodiments described herein.However, it will be understood by those of ordinary skill in the artthat the exemplary embodiments described herein may be practiced withoutthese specific details. In other instances, methods, procedures, andcomponents have not been described in detail so as not to obscure therelated relevant feature being described. Also, the description is notto be considered as limiting the scope of the embodiments describedherein. The drawings are not necessarily to scale and the proportions ofcertain parts have been exaggerated to better illustrate details andfeatures of the disclosure.

Several definitions that apply throughout this disclosure will now bepresented.

The term “coupled” is defined as connected, whether directly orindirectly through intervening components, and is not necessarilylimited to physical connections. The connection may be such that theobjects are permanently connected or releasably connected. The term“substantially” is defined to be essentially conforming to theparticular dimension, shape, or other feature that the term modifies,such that the component need not be exact. The term “comprising,” whenutilized, is “including, but not necessarily limited to”; itspecifically indicates open-ended inclusion or membership in theso-described combination, group, series, and the like. References to“an” or “one” exemplary embodiment in this disclosure are notnecessarily to the same exemplary embodiment, and such references mean“at least one.”

FIG. 1 illustrates a functional block diagram of an image processingdevice according to an exemplary embodiment of the disclosure. As shownin FIG. 1, the image processing device 100 for achieving panoramicimages comprises a camera unit 110, a gyroscope (gyro) 120, and aprocessing unit 130. The camera 110 captures a first image and a secondimage. The gyro 120 receives location information of the imageprocessing device 100. The processing unit 130 receives the first imageand the second image to generate first features and second featuresaccording to a feature-capturing algorithm. The feature-capturingalgorithm in this invention is FAST algorithm (Features from AcceleratedSegment Test). FAST algorithm is a corner detection method, which couldbe used to extract features and later used to track and map objects inmany computer vision tasks. FAST algorithm generates features accordingto the brightness of pixels. The feature is defined as the pixels thatexceed the threshold of the FAST algorithm FAST algorithm uses a circleof 16 pixels to classify whether a candidate point is actually a corner.Each pixel in the circle is labeled from the integer 1 to 16 in aclockwise direction. When a set of N contiguous pixels in the circle areall brighter than the intensity of candidate pixel and exceeding thethreshold or are all darker than the intensity of candidate pixel andless than the threshold, then the pixel is classified as the corner. Thethreshold value can be defined by users. The processing unit 130 obtainslocation information of predicted features on the second image by gyro120. The first features and the second features are transferred to a 3Dspace. The distances between the predicted features and the secondfeatures are calculated according to Euclidean distance. The processingunit 130 obtains selected second features by discarding the predictedfeatures, which exceed a predetermined distance from the secondfeatures, and produces the panorama image by combining the first imageand the second image according to the first features and the selectedsecond features.

Furthermore, the distribution of features in one image will varydepending on the complexity of the captured image. Edge-detection iseasy when the image is simple, but needs more features to distinguishthe edges when the image is complicated. The processing unit 130 splitsthe image as a plurality of sub-images and updates the threshold offeature-capturing algorithm on each sub-image. This improves accuracy ofgenerating the panoramic image and increases efficiency of the operationby obtaining more representative features.

FIG. 2 illustrates a flow diagram of an image processing methodaccording to an exemplary embodiment of the disclosure. As shown in FIG.2, the camera unit captures the first image and the second image (S201).The gyro obtains location information of the first image and the secondimage (S202). The feature-capturing algorithm generates the firstfeatures and the second features when the brightness exceeds thethreshold (S203). The predicted features in the second image areobtained by location information (S204). The first features and thesecond features are transferred to 3D space to confirm the firstfeatures and the second features are in the same 3D space (S205). Thedistances between the second features and the predicted features areobtained according to Euclidean distance. Second features are discardedwhen the distances between the second features and the predictedfeatures exceed a predetermined distance (S206). A rotation matrixbetween the first features and the second features is obtained accordingto Euler angles (S207). The processing unit combines the first featuresand the second features according to the rotation matrix (S208).

FIG. 3A illustrates a first image 310 according to the exemplaryembodiment of the disclosure. As shown in FIG. 3A, the first image 310is captured by the image processing device. The first features 311 areobtained according to the feature-capturing algorithm (the features inFIG. 3A are only for an example).

FIG. 3B illustrates a second image 320 according to the exemplaryembodiment of the disclosure. As shown in FIG. 3B, the second image 320is captured by the user holding the image processing device 100 moving adistance away from the viewpoint of the first image 310 in FIG. 3A. Thelocation information is obtained according to the gyro 120. Theprocessing unit 130 obtains the predicted features according to thelocation information and obtains the second features 321 according tothe feature-capturing algorithm. The processing unit 130 discards thesecond features 321 that exceed a predetermined distance between thesecond features 321 and the location of the predicted features.

FIG. 3C illustrates a third image 330 according to the exemplaryembodiment of the disclosure. As shown in FIG. 3C, the panorama image isthe result of combining the first image 310 in FIG. 3A and the secondimage 320 in FIG. 3B. The second features 321 in the second image 320are correspond to the first features 311 in the first image 310. Therotation matrix between the first features 311 and the correspondingsecond features 321 is formed by combining the relationship according toEuler angles. The panorama image is obtained according to the rotationmatrix relationship between the first image 310 and the second image320.

FIG. 4 illustrates another flow diagram of the image processing methodaccording to an exemplary embodiment of the disclosure. As shown in FIG.4, the camera unit captures the first image and the second image (S401).The location information between the first image and the second image isobtained by the gyro (S402). The feature-capturing algorithm generatesthe first features according to the default threshold of thefeature-capturing algorithm (S403). The processing unit splits the firstimage into a plurality of first sub-images and the second image into aplurality of second sub-images. The second image is split in the samemanner as the first image (S404). The feature-capturing algorithmrecalculates an updated threshold according to the numbers of the firstfeatures. The first features in the first sub-image are representativewhen the numbers of the first features are less than the average. Thefeature-capturing algorithm raises the threshold to obtain fewer firstfeatures, to improve the efficiency of the operation. Conversely, thefirst sub-image is more complicated when the numbers of the firstfeatures are larger than the average. The feature-capturing algorithmreduces the threshold to detect the edges of the first sub-image (S405).The feature-capturing algorithm generates the first features and thesecond features according to the updated threshold (S406). The predictedfeatures in the second image are obtained by location information(S407). The first features and the second features are transferred to 3Dspace to make sure the first features and the second features are in thesame space (S408). The distances between the second features and thepredicted features are obtained according to Euclidean distance. Thesecond features are discarded when the distances between the secondfeatures and the predicted features exceed a predetermined distance(S409). The rotation matrix between the first features and the secondfeatures is obtained according to Euler angles (S410). The processingunit combines the first features and the second features according tothe rotation matrix (S411).

FIG. 5 illustrates an updated threshold of sub-images of the imageprocessing method, according to an exemplary embodiment of thedisclosure. As shown in FIG. 5, the image is split into 3×2 sub-images.The default threshold of the feature-capturing algorithm is 50. Thefeature-capturing algorithm obtains 50 features in the first sub-image501, 20 features in the second sub-image 502, 80 features in the thirdsub-image 503, 100 features in the fourth sub-image 504, 140 features inthe fifth sub-image 505, and 90 features in the sixth sub-image 506. Thefeature-capturing algorithm adjusts the updated thresholds in eachsub-image. The processing unit obtains 80 as the average number and thestandard deviation is 41.47 according to the number of the features ineach sub-images. The processing unit obtains Z value and P valueaccording to the average number and the standard deviation in eachsub-image. When the number of features of the sub-image is less than theaverage, the threshold is multiplied by the reciprocal of P value. Whenthe number of features of the sub-image is larger than the average, thethreshold is multiplied by the P value. The first sub-image 501 and thefifth sub-image 505 are taken as an example. Z1 is a value of the firstsub-image 501. In this example, Z1 is |(50-80)/41.47|=0.74. P1 is avalue of the first sub-image 501. In this example, P1 is 0.77. Z5 is avalue of the fifth sub-image 505. In this example, Z5 is 1.45. P5 is avalue of the fifth sub-image 505. In this example, P5 is 0.92. Thenumbers of first features is 50, which is less than the average of 80.Thus, the updated threshold of the first sub-image is obtained bymultiplying default threshold and the reciprocal of P1[50*(1/0.77)=64.9]. The number of the fifth features is 140, which islarger than the average of 80. Thus, the updated threshold of the fifthsub-image is obtained by multiplying a default threshold and the P5[50*0.92=46].

Users should maintain a specific posture when taking the panoramaimages. The image processing device and the method improve ease andconvenience by comparing the predicted features and the second features.The panorama image is obtained by combining the first image and thesecond image. Furthermore, the image is split into many sub-images toadjust the number of features according to the differences of theimages. In this way, the image processing method enhances the accuracyof synthetic images and reduces image processing time, being applicableto all handheld image processing devices, such as mobile phones, pad,digital cameras, etc.

The exemplary embodiments shown and described above are only examples.Therefore, many details of such art are neither shown nor described.Even though numerous characteristics and advantages of the technologyhave been set forth in the foregoing description, together with detailsof the structure and function of the disclosure, the disclosure isillustrative only, and changes may be made in the detail, especially inmatters of shape, size, and arrangement of the parts within theprinciples of the present disclosure, up to and including the fullextent established by the broad general meaning of the terms used in theclaims. It will therefore be appreciated that the exemplary embodimentsdescribed above may be modified within the scope of the claims.

What is claimed is:
 1. An image processing method, for a panorama image,comprising: capturing a first image and a second image by a camera unit;obtaining a location information between the first image and the secondimage by a gyro; obtaining a plurality of first features of the firstimage and a plurality of second features of the second image accordingto a feature-capturing algorithm when brightness difference between thefirst features and the second features exceed a threshold; obtainingpredicted features in the second image by the location information;obtaining selected second features by discarding the predicted featuresexceeding a predetermined distance from the second features; andproducing the panorama image by combining the first image and the secondimage according to the first features and the selected second features;splitting the first image as a plurality of first sub-images and thesecond image as a plurality second sub-images; and updating thethreshold of the feature-capturing algorithm on each of first sub-imagesaccording to numbers of the first features, raises the threshold whenthe number of the first features on the first sub-image is less than anaverage of the numbers of the first features on each of sub-images,reduces the threshold when the number of the first features on the firstsub-image is more than the average of the numbers of the first featureson each of sub-images.
 2. The image processing method as claimed inclaim 1, further comprising obtaining the distance between the secondfeatures and the corresponding predicted features according to Euclideandistance.
 3. The image processing method as claimed in claim 1, furthercomprising obtaining a rotation matrix between the first features andthe corresponding second features according to Euler angles, andproduces the panorama images according to the rotation matrix to combinethe first image and the second image.